local skill = fk.CreateSkill {
  name = "graft_and_transplant_skill",
}
Fk:loadTranslationTable{
  ["graft_and_transplant_skill"] = "移花接木",
  ["#graft_and_transplant_skill"] = "选择一名有牌的其他角色，令其选择一项：1.使用一张【杀】；2.交给你两张牌。",
  ["#honey_trap-ask"] = "使用一张【杀】；或者交给 %src 两张牌",
  ["#honey_trap-ask2"] = "交给 %src 两张牌",
}

skill:addEffect("cardskill", {
  prompt = "#graft_and_transplant_skill",--提示文本
  can_use = Util.CanUse,--是否可用
  target_num = 1,--目标数
  mod_target_filter = function(self, player, to_select, selected, card)--对象范围
    return to_select ~= player and not to_select:isNude()
    --     不含玩家自己             对面有牌
  end,
  target_filter = Util.CardTargetFilter,
  on_effect = function(self, room, effect)--结算
    local player = effect.from
    local target = effect.to
    local room = player.room
    local use = room:askToUseCard(target,{--询问对方用杀
        skill_name = "slash",
        pattern = "slash",
        prompt = "#honey_trap-ask:" .. player.id,
        cancelable = true,
        event_data = effect,
    })
    if use then
        --用杀
          use.extraUse = true
          room:useCard(use)
    else
        --给牌
        if target.dead then return end
        local cards = target:getCardIds{Player.Hand, Player.Equip}--获得目标有多少牌
        if #cards > 2 then--多于两张时才选择
            cards = room:askToCards(target, {
                min_num = 2,
                max_num = 2,
                include_equip = true,
                skill_name = skill.name,
                prompt = "#honey_trap-ask2:" .. player.id,
                cancelable = false,
            })
        end
        if #cards > 0 then--给牌
            room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonGive, skill.name, nil, false, target.id)
        end
    end
  end
})

return skill
